// packageJ/chain-store/mycomponent/numCartSelect/numCartSelect.js
const cartPost = require('../cart');
const skinBehavior = require('../../../../utils/themeSkin/skinBehavior');
const app = getApp();
Component({
  behaviors: [cartPost, skinBehavior],
  /**
   * 组件的属性列表
   */
  properties: {
    goodsInfo: {
      type: null,
    },
    carts: {
      type: null
    },
    store_id: {
      type: null
    },
    optionsId: {
      type: null
    }
  },

  /**
   * 组件的初始数据
   */
  data: {

  },

  /**
   * 组件的方法列表
   */
  methods: {
    // 减少
    leftTap(e) {
      console.log(this.data.goodsInfo)
      let {
        id
      } = e.currentTarget.dataset;
      this.updateCartRequest(id, '-1', this.data.store_id)
    },
    blur(e) {
      console.log(e.detail.value)
      let {
        id
      } = e.currentTarget.dataset;
      this.childBlur(e.detail.value, id, this.data.store_id)
    },
    foucus(e) {
      this.childFoucus(e.detail.value)
    },
    rightTap(e) {
      let {
        id
      } = e.currentTarget.dataset;
      this.updateCartRequest(id, '1', this.data.store_id)
    },

  }
})